#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

void FindNum(int arr[], int n, int* pnum1, int* pnum2)
{
	int ret = 0;
	int k = 0;
	for (int i = 0;i < n;i++)
	{
		ret ^= arr[i];
	}
	for (k = 0;k < 32;k++)
	{
		if (((ret >> k) & 1))
		{
			break;
		}
	}
	for (int i = 0;i < n;i++)
	{
		if ((arr[i] >> k) & 1)
		{
			*pnum1 ^= arr[i];
		}
		else
		{
			*pnum2 ^= arr[i];
		}
	}
}

int main()
{
	int arr[10] = { 1,2,3,4,5,1,2,3,4,6 };
	int n = sizeof(arr) / sizeof(arr[0]);
	int num1 = 0;
	int num2 = 0;
	FindNum(arr, n, &num1, &num2);
	printf("%d %d", num1, num2);
	return 0;
}
